package com.gaga.metadata.common.enums;

/**
 * 表修改类型
 * ColumnUpdateType
 **/
public enum TableUpdateType {

    COMMENT("comment", "修改表描述", "name");

    private String code;
    private String desc;
    private String modelColumnMapper;

    TableUpdateType(String code, String desc, String modelColumnMapper) {
        this.code = code;
        this.desc = desc;
        this.modelColumnMapper = modelColumnMapper;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getModelColumnMapper() {
        return modelColumnMapper;
    }


    public static TableUpdateType ofCode(String modelColumnMapper) {
        for (TableUpdateType dbType : values()) {
            if (dbType.modelColumnMapper.equalsIgnoreCase(modelColumnMapper)) {
                return dbType;
            }
        }
        return null;
    }

}
